<template>
	<view>
		<view>
			<uni-nav-bar shadow left-icon="left" dark title="绩效升降级管理" @clickLeft="back()"/>
		 
		
		</view>
		<uni-row >
			<uni-col :span="12"><uni-easyinput class="uni-mt-5" suffixIcon="search" v-model="SupplierScoreForm.personName"  placeholder="考评人员" @iconClick="iconClick"></uni-easyinput></uni-col>
			<uni-col :span="12"><uni-easyinput class="uni-mt-5" suffixIcon="search" v-model="SupplierScoreForm.supplierName" placeholder="供应商" @iconClick="iconClick"></uni-easyinput></uni-col>
		</uni-row>
		<view v-for="(item,index) in SurScoreFormTable" :key="index">
			<uni-card>
			<uni-row><text style="font-weight: 600;">编码:</text>{{item.code}}</uni-row>
			<uni-row><text style="font-weight: 600;">编号:</text>{{item.number}}</uni-row>
			<uni-row><text style="font-weight: 600;">考评人员:</text>{{item.personName}}</uni-row>
			<uni-row><text style="font-weight: 600;">供应商名称:</text>{{item.supplierName}}</uni-row>
			<uni-row><text style="font-weight: 600;">考评日期:</text>{{item.dateStart}}至{{item.dateOver}}</uni-row>

			<uni-row v-if="item.status==1"><text style="font-weight: 600;">评分状态:</text><text style="background-color: gold;border-radius:10rpx;color:#fff;">评分中</text></uni-row>
			<uni-row v-if="item.status==0"><text style="font-weight: 600;">评分状态:</text><text style="background-color: gold;border-radius:10rpx;color:#fff;">已评分</text></uni-row>
			<uni-row v-if="item.examineStatus==0"><text style="font-weight: 600;">审核状态:</text><text style="background-color: gold;border-radius:10rpx;color:#fff;">待审核</text></uni-row>
			<uni-row v-if="item.examineStatus==1"><text style="font-weight: 600;">审核状态:</text><text style="background-color: gold;border-radius:10rpx;color:#fff;">已通过</text></uni-row>
			<uni-row v-if="item.examineStatus==2"><text style="font-weight: 600;">审核状态:</text><text style="background-color: red;border-radius:10rpx;color:#fff;">未通过</text></uni-row>
			<uni-row v-if="item.examineStatus ==0" style="text-align: center;"><button size="mini" type="warn" @click="performance_management_detail(SurScoreFormTable[index])">审批</button></uni-row>
			</uni-card>
		
		</view>
			
	</view>
</template>

<script>
	import {SurScoreFormDatatable} from "@/api/system/user"
	export default {
		data() {
			return {
				SurScoreFormTable:null,
				SupplierScoreForm:{
					page: 1,
					rows: 20,
					personName:null,
					supplierName:null,
				}
			}
		},
		onLoad() {
			this.get()
		},
		methods: {
			iconClick(){
				this.get()
			},
			get(){
				SurScoreFormDatatable(this.SupplierScoreForm).then( res=>{
					this.SurScoreFormTable =res.rows
				})
			},
			back(){
			 this.$tab.reLaunch('/pages/work/purchaser/index')
			},
			performance_management_detail(e){
				uni.navigateTo({
				       url: '/pages/work/purchaser/performance_management_detail',
				       success: (respost) => {
				           // 通过eventChannel向被打开页面传送数据
				           respost.eventChannel.emit('acceptDataFromOpenerPage', {data:e},
						   )}
				     });
	
					}
		}
	}
</script>

<style>

</style>
